<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
    <title id="bv20941">DROP FOREIGN TABLE</title>
    <body>
        <p id="sql_command_desc">Removes a foreign table.</p>
        <section id="section2">
            <title>Synopsis</title>
            <codeblock id="sql_command_synopsis">DROP FOREIGN TABLE [ IF EXISTS ] <varname>name</varname> [, ...] [ CASCADE | RESTRICT ]</codeblock>
        </section>
        <section id="section3">
            <title>Description</title>
            <p><codeph>DROP FOREIGN TABLE</codeph> removes an existing foreign table.
              Only the owner of a foreign table can remove it.</p>
        </section>
        <section id="section4">
            <title>Parameters</title>
            <parml>
                <plentry>
                    <pt>IF EXISTS</pt>
                    <pd>
                        <p>Do not throw an error if the foreign table does not exist. Greenplum Database issues a notice in this case.</p>
                    </pd>
                </plentry>
                <plentry>
                    <pt><varname>name</varname></pt>
                    <pd>
                        <p>The name (optionally schema-qualified) of the foreign table to drop.</p>
                    </pd>
                </plentry>
                <plentry>
                    <pt>CASCADE</pt>
                    <pd>
                        <p>Automatically drop objects that depend on the foreign table (such as views).</p>
                    </pd>
                </plentry>
                <plentry>
                    <pt>RESTRICT</pt>
                    <pd>
                        <p>Refuse to drop the foreign table if any objects depend on it. This is the default.</p>
                    </pd>
                </plentry>
            </parml>
        </section>
        <section id="section6">
            <title>Examples</title>
            <p>Drop the foreign tables named <codeph>films</codeph> and <codeph>distributors</codeph>:</p><codeblock>DROP FOREIGN TABLE films, distributors;</codeblock>
        </section>
        <section id="section7">
            <title>Compatibility</title>
            <p><codeph>DROP FOREIGN TABLE</codeph> conforms to ISO/IEC 9075-9 (SQL/MED), except that the standard only allows one foreign table to be dropped per command. The <codeph>IF EXISTS</codeph> clause is a Greenplum Database extension.</p>
        </section>
        <section id="section8">
            <title>See Also</title>
            <p><codeph><xref href="ALTER_FOREIGN_TABLE.xml#topic1">ALTER FOREIGN TABLE</xref></codeph>,
                        <codeph><xref href="CREATE_FOREIGN_TABLE.xml#topic1">CREATE
                    FOREIGN TABLE</xref></codeph></p>
        </section>
    </body>
</topic>
